<template>
  <div class="yongjindakuan">
    <div v-if="!shoujiban">
      <left></left>
      <div class="right">
        <div
          style="
            height: 91px;
            border-bottom: 1px solid rgb(227, 232, 241);
            width: 100%;
            padding: 0 30px;
          "
          class="flexbc"
        >
          <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item :to="{ path: '/yongjin' }"
              >佣金结算</el-breadcrumb-item
            >
            <el-breadcrumb-item>佣金打款</el-breadcrumb-item>
          </el-breadcrumb>
          <top></top>
        </div>
        <div
          style="
            padding: 37px 30px 0 30px;
            height: calc(100vh - 91px);
            overflow: auto;
          "
        >
          <div class="flex" style="justify-content: space-between">
            <div class="flexc" style="padding: 0px 0 20px">
              <div>
                <el-button
                  style="margin: 0px 10px"
                  type="primary"
                  v-if="search.status != 10"
                  round
                  @click="changestatus('')"
                  >待打款</el-button
                >
              </div>
              <div>
                <el-button
                  style="margin: 0px 10px"
                  v-if="search.status == 10"
                  round
                  @click="changestatus()"
                  >待打款</el-button
                >
              </div>
              <div>
                <el-button
                  style="margin: 0px 10px"
                  v-if="search.status != 10"
                  round
                  @click="changestatus(10)"
                  >已打款</el-button
                >
              </div>
              <div>
                <el-button
                  style="margin: 0px 10px"
                  type="primary"
                  v-if="search.status == 10"
                  round
                  @click="changestatus(10)"
                  >已打款</el-button
                >
              </div>
            </div>
            <div>&nbsp;</div>
            <div class="flexc" style="padding: 0px 0 20px">
                            <div
                style="
                  width: 258px;
                  height: 40px;
                  margin: 0px 10px;
                  background-color: #ebeef2;
                  border-radius: 25px;
                "
              >
                <img
                  style="margin: 10px 186px 10px 22px"
                  src="../../../static/img/shizhong.png"
                />
                <div style="margin: -31px 22px 10px 50px">
                  待打款订单数 :
                  <span style="color: rgb(255, 0, 60)">{{ wait_count }}</span>
                </div>
              </div>
                            <div
                style="
                  width: 258px;
                  height: 40px;
                  margin: 0px 10px;
                  background-color: #ebeef2;
                  border-radius: 25px;
                "
              >
                <img
                  style="margin: 10px 186px 10px 22px"
                  src="../../../static/img/shizhong.png"
                />
                <div style="margin: -31px 22px 10px 50px">
                  待打款 :
                  <span style="color: rgb(255, 0, 60)">{{ wait_money  }}</span>
                </div>
              </div>
              <div
                style="
                  width: 258px;
                  height: 40px;
                  margin: 0px 10px;
                  background-color: #ebeef2;
                  border-radius: 25px;
                "
              >
                <img
                  style="margin: 10px 186px 10px 22px"
                  src="../../../static/img/shizhong.png"
                />
                <div style="margin: -31px 22px 10px 50px">
                  今日打款 :
                  <span style="color: rgb(255, 0, 60)">{{ jinriJine }}</span>
                </div>
              </div>
              <div
                style="
                  width: 285px;
                  height: 40px;
                  margin: 0px 10px;
                  background-color: #ebeef2;
                  border-radius: 25px;
                "
              >
                <img
                  style="margin: 10px 186px 10px 22px"
                  src="../../../static/img/riLi.png"
                />
                <div style="margin: -31px 22px 10px 50px">
                  历史累计打款 :
                  <span style="color: rgb(255, 0, 60)">{{ lishijine }}</span>
                </div>
              </div>
            </div>
          </div>
          <!-- <div class="flexc" style="padding: 0px 0 20px;">
            <div>
              <el-button style="margin: 0px 10px;" type="primary" v-if="search.status != 10" round @click="changestatus('')">待打款</el-button>
            </div>
            <div><el-button style="margin: 0px 10px;" v-if="search.status == 10" round @click="changestatus()">待打款</el-button></div>
            <div><el-button style="margin: 0px 10px;" v-if="search.status != 10" round  @click="changestatus(10)">已打款</el-button></div>
            <div><el-button style="margin: 0px 10px;" type="primary" v-if="search.status == 10" round  @click="changestatus(10)">已打款</el-button></div>
          </div> -->

          <div
            style="
              background: rgb(255, 255, 255);
              border-radius: 20px;
              padding: 20px;
            "
            class="flexb"
          >
            <div class="flex">
              <div>
                <div style="margin-bottom: 10px">提现人</div>
                <div>
                  <el-input
                    v-model="search.merchant_name"
                    style="width: 200px; margin-right: 30px"
                    placeholder="请输入"
                  ></el-input>
                </div>
              </div>
              <div v-if="search.status == 10">
                <div style="margin-bottom: 10px">打款方式</div>
                <div>
                  <el-select
                    clearable
                    filterable
                    style="width: 200px; margin-right: 30px"
                    v-model="search.pay_way"
                    placeholder="请选择"
                  >
                    <!-- 0未知 1 线下 2 云账户 3支付宝 4微信 5工猫 -->
                    <el-option label="全部" :value="0"></el-option>
                    <el-option label="线下" :value="1"></el-option>
                    <el-option label="云账户" :value="2"></el-option>
                    <el-option label="支付宝" :value="3"></el-option>
                    <el-option label="微信" :value="4"></el-option>
                    <el-option label="工猫" :value="5"></el-option>
                  </el-select>
                </div>
              </div>
              <div v-if="dakuanStatus">
                <div style="margin-bottom: 10px">打款状态</div>
                <div>
                  <el-select
                    clearable
                    filterable
                    style="width: 200px; margin-right: 30px"
                    v-model="search.status"
                    placeholder="请选择"
                  >
                    <!-- <el-option  label="已打款"  value="10"></el-option> -->
                    <el-option label="待打款" value="0"></el-option>
                    <el-option label="打款失败" value="1"></el-option>
                    <el-option label="打款中" value="2"></el-option>
                    <el-option label="已驳回" value="5"></el-option>
                  </el-select>
                </div>
              </div>
              <div>
                <div style="margin-bottom: 10px">打款时间</div>
                <div class="flexc">
                  <el-date-picker
                    v-model="times"
                    @change="changetimes"
                    value-format="yyyy-MM-dd HH:mm:ss"
                    style="margin-right: 30px"
                    type="datetimerange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                  ></el-date-picker>

                  <el-button
                    type="primary"
                    round
                    icon="el-icon-search"
                    @click="sousuo"
                    >检索</el-button
                  >
                </div>

              </div>



            </div>
            <div style="padding-top: 31px;" class="flex">
              <!-- <el-button
                type="primary"
                style="margin-right: 2px"
                round
                icon="el-icon-bank-card"
                @click="zidongdakuan"
                >自动打款配置</el-button
              > -->
              <img src="https://file.91haoka.cn/gantanhao/xlhdakuan1.png" style="width: 150px; cursor: pointer;" @click="zidongdakuan">
              <img src="https://file.91haoka.cn/gantanhao/xlhdakuan2.png" style="width: 125px; cursor: pointer; margin-left: 20px;" @click="peizhikai">
              <!-- <el-button
                type="primary"
                style="margin-right: 55px"
                round
                icon="el-icon-search"
                @click="peizhikai"
                >发票配置</el-button
              > -->
            </div>


          </div>

          <div style="margin-right: 30px; padding: 20px 0;" class="flexc">

            <el-button
            v-if="search.status != 10"
              round
              @click="daochu"
              style="margin-left: 10px"
              >导出待打款记录</el-button
            >
            <el-button
              v-if="search.status == 10"
              round
              @click="daochu"
              style="margin-left: 10px"
              >导出已打款记录</el-button
            >


            <el-upload
              :show-file-list="false"
              action="#"
              ref="upload"
              :http-request="uploasd"
            >
              <el-button
                type="primary"
                round
                style="margin-left: 10px"
                >线下打款批量确认</el-button
              >
            </el-upload>

          <a style="margin-left: 10px; font-size: 12px; color: #005aff;" href="https://file.91haoka.cn/gantanhao/%E7%BA%BF%E4%B8%8B%E6%89%93%E6%AC%BE%E6%89%B9%E9%87%8F%E7%A1%AE%E8%AE%A4.xlsx?attname=">模板下载</a>


          </div>

          <el-table :data="list" style="width: 100%">
            <el-table-column
              fixed
              align="center"
              prop="id"
              label="提现ID"
            ></el-table-column>
            <el-table-column align="center" label="申请提现人"  width="200">
              <template slot-scope="scope">
                <div
                  style="color: rgb(0, 90, 255); cursor: pointer"
                  @click="clickxiangxixinxi(scope.row)"
                >
                  {{ scope.row.shop_name }}
                </div>
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              width="200px"
              prop="withdraw_at"
              label="提现申请时间"
            ></el-table-column>
            <el-table-column
              width="160"
              align="center"
              prop="orders_count"
              label="提现订单数量"
            ></el-table-column>
            <el-table-column
              width="160"
              align="center"
              prop="orders_count"
              label="发展订单数量"
            >
            <template slot-scope="scope">
              <div>
                {{ scope.row.orders_count - scope.row.reward_count }}
              </div>
            </template>

            </el-table-column>
            <el-table-column
              width="160"
              align="center"
              prop="reward_count"
              label="奖励订单数量"
            ></el-table-column>
            <el-table-column
              align="center"
              prop="sum_commission"
              label="提现金额"
            ></el-table-column>
            <el-table-column align="center" prop="invoice_way" label="票据类型" width="160">
              <template slot-scope="scope">
                <div
                  @click="log6show(scope.row)"
                  style="color: rgb(0, 90, 255)"
                >
                  {{ scope.row.invoice_info }}
                </div>
              </template>
            </el-table-column>
            <el-table-column
            width="160"
              align="center"
              prop="tax_amount"
              label="扣除税点金额"
            ></el-table-column>
            <el-table-column
            width="160"
              align="center"
              prop="withdraw_amount"
              label="实际支出金额"
            ></el-table-column>
            <el-table-column align="center" label="打款状态" width="150px">
              <template slot-scope="scope">
                <div
                  v-if="scope.row.status == 10"
                  style="color: rgb(9, 134, 0)"
                >
                  已打款
                </div>
                <div
                  v-if="scope.row.status == 0"
                  style="color: rgb(236, 82, 1)"
                >
                  待打款
                </div>
                <div
                  v-if="scope.row.status == 1"
                  style="color: rgb(236, 82, 1)"
                >
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="scope.row.failed_reason"
                    placement="top"
                  >
                    <div>
                      打款失败
                      <i
                        style="color: rgb(236, 82, 1)"
                        class="el-icon-warning"
                      ></i>
                    </div>
                  </el-tooltip>
                </div>
                <div
                  v-if="scope.row.status == 2"
                  style="color: rgb(236, 82, 1)"
                >
                  打款中
                </div>
                <div
                  v-if="scope.row.status == 5"
                  style="color: rgb(236, 82, 1)"
                >
                  已驳回
                </div>
                <div
                  v-if="scope.row.status == 11"
                  style="color: rgb(9, 134, 0)"
                >
                  已自动打款
                </div>
                <div
                  v-if="scope.row.status == 15"
                  style="color: rgb(236, 82, 1)"
                >
                  <el-tooltip
                    class="item"
                    effect="dark"
                    :content="scope.row.failed_reason"
                    placement="top"
                  >
                    <div>
                      自动打款失败
                      <i
                        style="color: rgb(236, 82, 1)"
                        class="el-icon-warning"
                      ></i>
                    </div>
                  </el-tooltip>
                </div>
              </template>
            </el-table-column>
            <el-table-column
              align="center"
              width="150px"
              prop="pay_way"
              label="打款方式"
            >
              <template slot-scope="scope">
                <div v-if="scope.row.pay_way == 0 && scope.row.status != 0">
                  --
                </div>
                <div v-if="scope.row.pay_way == 0 && scope.row.status == 0">
                  --
                </div>
                <div v-if="scope.row.pay_way == 1">线下</div>
                <div v-if="scope.row.pay_way == 2">云账户</div>
                <div v-if="scope.row.pay_way == 3">支付宝</div>
                <div v-if="scope.row.pay_way == 4">微信</div>
                <div v-if="scope.row.pay_way == 5">工猫</div>
              </template>
            </el-table-column>
            <el-table-column v-if="search.status != 10"
              align="center"
              width="200px"
              prop="withdraw_at"
              label="打款时间"
            >
            <template slot-scope="scope">--</template>
            </el-table-column>
            <el-table-column  v-if="search.status == 10"
              align="center"
              width="200px"
              prop="withdraw_at"
              label="打款时间"
            ></el-table-column>
            <el-table-column
              align="center"
              label="操作"
              width="250px"
              fixed="right"
            >
              <template slot-scope="scope">
                <div class="flexcc" style="justify-content: flex-start;" >
                  <div
                    v-if="scope.row.status == 10 || scope.row.status == 11"
                    style="
                      color: rgb(0, 90, 255);
                      cursor: pointer;
                      margin-right: 20px;

                    "
                    @click="clickDetails(scope.row)"
                  >
                    查看详情
                  </div>
                  <!-- 线下打款 -->
                  <!-- <div v-if="scope.row.status == 0||scope.row.status == 2 || scope.row.status == 1" style="color: rgb(0, 90, 255); cursor: pointer; margin-right: 20px;" @click="luru(scope.row,2)">录入打款信息</div> -->
                  <!-- 支付宝打款 -->
                  <!-- <div v-if="(scope.row.status == 0||scope.row.status == 1)&& scope.row.collect_type==2 && zhifubaom" style="color: rgb(0, 90, 255); cursor: pointer; margin-right: 20px;" @click="payyzh(scope.row,2)">支付宝打款</div> -->
                  <!-- 云账户打款 -->
                  <!-- <div v-if="nowmoneyobj.total_balance!=''&&(scope.row.status == 0||scope.row.status == 1) && scope.row.invoice_info == '无发票'" style="color: rgb(0, 90, 255); cursor: pointer;" @click="payyzh(scope.row)">云账户打款</div> -->
                  <div
                    v-if="
                      scope.row.status == 0 ||
                      scope.row.status == 1 ||
                      scope.row.status == 15
                    "
                    style="
                      color: rgb(0, 90, 255);
                      cursor: pointer;
                      margin-right: 20px;
                    "
                    @click="dakuan(scope.row)"
                  >
                    打款
                  </div>
                  <!-- <div v-if="scope.row.status == 2"  >打款中</div> -->
                  <div
                    v-if="
                      scope.row.status == 0 ||
                      scope.row.status == 1 ||
                      scope.row.status == 15
                    "
                    style="
                      color: rgb(0, 90, 255);
                      cursor: pointer;
                      margin-right: 20px;
                    "
                    @click="boHui(scope.row)"
                  >
                    驳回
                  </div>
                </div>
              </template>
            </el-table-column>
          </el-table>

          <el-pagination
            style="text-align: right; padding: 20px"
            background
            layout="prev,pager,next,total,jumper"
            :current-page="search.page"
            @current-change="fanye"
            :page-size="search.page_size"
            :total="total"
          >
          </el-pagination>
          <!-- <footers></footers> -->
        </div>
      </div>
    </div>

    <!-- <van-popup v-model="show" position="center" style="width: 500px;">
    	<van-area :area-list="areaList" :columns-placeholder="['请选择', '请选择', '请选择']" @confirm="queren" @cancel="quxiao" />
    </van-popup> -->
    <el-dialog
      title="自动打款配置"
      :visible.sync="zidongdakuanDialog"
      width="500px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <div style="margin-top: -12px">
        <div style="display: inline; font-weight: bold">
          用户无票申请提现后自动打款
        </div>
        <el-switch
          v-model="isDakuanObj.auto_payment"
          @change="changeSwitch($event, row)"
        >
        </el-switch>
      </div>
      <div style="margin-top: 20px">
        开启后，用户使用无发票提现，账户将自动打款
      </div>
      <div style="margin-top: 20px">自动打款使用平台:</div>
      <div>
        <el-select
          v-model="isDakuanObj.payment_type"
          placeholder="请选择使用平台"
          style="margin-top: 20px"
          @change="changepingtai"
        >
          <el-option
            v-for="item in pingtaioptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          >
          </el-option>
        </el-select>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button round @click="undozidongdakuan">取消</el-button>
        <el-button type="primary" round @click="makeSurezidongdakuan"
          >确认</el-button
        >
      </div>
    </el-dialog>
    <el-dialog title="驳回打款" :visible.sync="boHuiDialog" width="500px">
      <div>
        <el-input
          class="t_changec"
          type="textarea"
          placeholder="请输入驳回原因"
          v-model="boHuiObj.remark"
          style="border-radius: 30px"
        >
        </el-input>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button round @click="undoBohui">取消</el-button>
        <el-button type="danger" round @click="makeSureBohui"
          >确定驳回</el-button
        >
      </div>
    </el-dialog>

    <el-dialog
      title="选择省市区"
      :visible.sync="show"
      width="640px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <van-area
        :area-list="areaList"
        :columns-placeholder="['请选择', '请选择', '请选择']"
        @confirm="queren"
        @cancel="quxiao"
      />
    </el-dialog>
    <el-dialog
      title="发票配置"
      :visible.sync="log"
      width="840px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <div style="font-size: 18px; margin-bottom: 20px">发票类型</div>
      <div style="margin-bottom: 20px">
        <div
          v-for="(item, index) in fapiaoall.configs.data"
          :key="item.type"
          style="
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
          "
        >
          <div class="flexc" style="width: 700px">
            <div style="margin-right: 20px">
              <el-checkbox
                v-model="item.ok"
                :true-label="1"
                :false-label="0"
              ></el-checkbox>
            </div>
            <div
              style="margin-right: 40px"
              :style="{ width: item.type == 5 ? '98px' : 'auto' }"
            >
              {{ item.name }}
            </div>
            <div v-if="item.type != 4 && item.type != 5">
              税点{{ toPercent(item.tax, 0) }}
            </div>
            <div v-if="item.type == 4">
              <el-select
                clearable
                filterable
                style="width: 200px; margin-right: 30px"
                v-model="item.tax"
                placeholder="请选择"
              >
                <el-option label="1%" :value="0.01"></el-option>
                <el-option label="2%" :value="0.02"></el-option>
                <el-option label="3%" :value="0.03"></el-option>
                <el-option label="4%" :value="0.04"></el-option>
                <el-option label="5%" :value="0.05"></el-option>
                <el-option label="6%" :value="0.06"></el-option>
              </el-select>
            </div>
            <div v-if="item.type == 5">
              <el-select
                clearable
                filterable
                style="width: 200px; margin-right: 30px"
                v-model="item.tax"
                placeholder="请选择"
              >
                <el-option label="0%" :value="0"></el-option>
                <el-option label="1%" :value="0.01"></el-option>
                <el-option label="2%" :value="0.02"></el-option>
                <el-option label="3%" :value="0.03"></el-option>
                <el-option label="4%" :value="0.04"></el-option>
                <el-option label="5%" :value="0.05"></el-option>
                <el-option label="6%" :value="0.06"></el-option>
              </el-select>
            </div>

            <div
              style="margin-left: 20px; color: #bbb"
              v-if="item.desc != 0 && item.type != 5"
            >
              ({{ item.desc }})
            </div>
            <div
              style="
                margin-left: 170px;
                color: #bbb;
                width: 500px;
                margin-top: 10px;
              "
              v-if="item.type == 5"
            >
              (如果选择0.6个点则表示并不扣除分销商税点，分销商不开票提现100到账100)
            </div>
          </div>

          <!-- 开启默认 -->
          <div v-if="item.ok">
            <div
              v-if="item.moren == ''"
              @click="peimoren(index)"
              style="color: #005aff; cursor: pointer"
            >
              设为默认
            </div>
            <div v-else style="display: flex">
              <div>默认</div>
              <div
                @click="resmoren(index)"
                style="margin-left: 20px; color: #005aff; cursor: pointer"
              >
                取消
              </div>
            </div>
          </div>
        </div>
      </div>
      <div style="display: flex; font-size: 13px; margin-bottom: 30px">
        <div>扣税方式：</div>
        <el-radio v-model="ksradio" :label="1">
          <div style="display: inline-grid">
            <div style="font-weight: normal">按照标准税务计算方式扣除</div>
            <div style="font-weight: normal; color: #c0c4cc; margin-top: 10px">
              计算公式：提现金额÷1.06*（6%-开票税点）
            </div>
          </div>
        </el-radio>
        <el-radio v-model="ksradio" :label="2">
          <div style="display: inline-grid">
            <div style="font-weight: normal">按照粗略方式扣除</div>
            <div style="font-weight: normal; color: #c0c4cc; margin-top: 10px">
              扣除计算公式：提现金额×(6%-开票税点)
            </div>
          </div>
        </el-radio>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px">开票信息</div>
      <div style="font-size: 12px; margin-bottom: 30px">
        <el-input
          type="textarea"
          :rows="5"
          placeholder="请输入内容"
          v-model="fapiaoall.info"
        ></el-input>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px">邮寄地址</div>
      <div class="flexc" style="margin-bottom: 20px">
        <div
          style="
            width: 100px;
            text-align: right;
            color: rgb(42, 42, 42);
            font-size: 14px;
            margin-right: 15px;
          "
        >
          输入收件人
        </div>
        <div>
          <el-input
            v-model="fapiaoall.addr_name"
            style="width: 200px; margin-right: 30px"
            placeholder="请输入收件人"
          ></el-input>
        </div>
      </div>
      <div class="flexc" style="margin-bottom: 20px">
        <div
          style="
            width: 100px;
            text-align: right;
            color: rgb(42, 42, 42);
            font-size: 14px;
            margin-right: 15px;
          "
        >
          联系电话
        </div>
        <div>
          <el-input
            v-model="fapiaoall.addr_mobile"
            style="width: 200px; margin-right: 30px"
            placeholder="请输入联系电话"
          ></el-input>
        </div>
      </div>
      <div class="flexc" style="margin-bottom: 20px">
        <div
          style="
            width: 100px;
            text-align: right;
            color: rgb(42, 42, 42);
            font-size: 14px;
            margin-right: 15px;
          "
        >
          收件地址
        </div>
        <div class="flex">
          <el-input
            v-model="fapiaoall.addr_province"
            style="width: 120px; margin-right: 30px"
            placeholder="请输入"
            @focus="show = true"
          ></el-input>
          <el-input
            v-model="fapiaoall.addr_city"
            style="width: 120px; margin-right: 30px"
            placeholder="请输入"
            @focus="show = true"
          ></el-input>
          <el-input
            v-model="fapiaoall.addr_district"
            style="width: 120px; margin-right: 30px"
            placeholder="请输入"
            @focus="show = true"
          ></el-input>
        </div>
      </div>
      <div class="flexc" style="margin-bottom: 20px">
        <div
          style="
            width: 100px;
            text-align: right;
            color: rgb(42, 42, 42);
            font-size: 14px;
            margin-right: 15px;
          "
        >
          &nbsp;
        </div>
        <div class="flex">
          <el-input
            v-model="fapiaoall.addr"
            style="width: 420px; margin-right: 30px"
            placeholder="请输入"
          ></el-input>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="log = false">关闭</el-button>
        <el-button round type="primary" @click="peizhi">确定</el-button>
      </span>
    </el-dialog>

    <!-- 查看详情弹窗 -->
    <el-dialog
      title="详情"
      :visible.sync="log3"
      width="800px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold">
        提现金额
      </div>
      <div
        style="
          background: rgb(255, 245, 245);
          border-radius: 10px;
          padding: 20px;
          justify-content: space-around;
          margin-bottom: 20px;
        "
        class="flexc"
      >
        <div style="text-align: center">
          <div
            style="color: rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px"
          >
            提现金额
          </div>
          <div
            style="color: rgb(254, 61, 61); font-size: 16px; font-weight: bold"
          >
            ￥{{ all2.sum_commission }}
          </div>
        </div>
        <div style="text-align: center">
          <div
            style="color: rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px"
          >
            扣除税额
          </div>
          <div
            style="color: rgb(254, 61, 61); font-size: 16px; font-weight: bold"
          >
            ￥{{ all2.tax_amount }}
          </div>
        </div>
        <div style="text-align: center">
          <div
            style="color: rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px"
          >
            实际应打款金额
          </div>
          <div
            style="color: rgb(254, 61, 61); font-size: 16px; font-weight: bold"
          >
            ￥{{ all2.withdraw_amount }}
          </div>
        </div>
      </div>

      <div
        style="
          font-size: 18px;
          margin-bottom: 20px;
          font-size: 14px;
          display: inline-block;
        "
      >
        开票类型:
      </div>
      <!-- <div v-if="all2.invoice_type==1||all2.invoice_type==2||all2.invoice_type==3" style="display: inline-block;">增值税专用发票</div>
      <div v-if="all2.invoice_type==4" style="display: inline-block;">增值税普通发票</div>
      <div v-if="all2.invoice_type==5" style="display: inline-block;">无发票</div> -->
      <div style="display: inline-block">{{ all2.invoice_info }}</div>
      <div
        v-if="
          all2.invoice_type == 1 ||
          all2.invoice_type == 2 ||
          all2.invoice_type == 3 ||
          all2.invoice_type == 4
        "
        style="
          display: inline-block;
          margin-left: 40px;
          color: rgb(0, 90, 255);
          cursor: pointer;
        "
        @click="viewFapiao"
      >
        查看发票
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold">
        收款账户
      </div>
      <div style="margin-bottom: 20px">
        <div
          class="flex"
          style="margin-bottom: 20px"
          v-if="all2.collect_type == 1"
        >
          <div style="width: 220px">卡号：{{ all2.bank_no }}</div>
          <div style="width: 220px; margin-left: 31px">
            开户人：{{ all2.bank_name }}
          </div>
          <div style="width: 230px; margin-left: -70px">
            身份证号：{{ all2.bank_idcard }}
          </div>
          <div style="width: 220px">开户行:{{ all2.bank }}</div>
          <div style="width: 220px; margin-left: 31px">
            开户支行:{{ all2.bank_sub }}
          </div>
        </div>
        <div
          class="flex"
          style="margin-bottom: 20px"
          v-if="all2.collect_type == 2"
        >
          <div style="width: 220px">支付宝号：{{ all2.ali_no }}</div>
          <div style="width: 220px">姓名：{{ all2.ali_name }}</div>
          <div style="width: 230px">身份证号：{{ all2.ali_idcard }}</div>
        </div>
        <div
          class="flex"
          style="margin-bottom: 20px"
          v-if="all2.collect_type == 3"
        >
          <div style="width: 220px">微信号：{{ all2.ali_no }}</div>
          <div style="width: 220px">姓名：{{ all2.ali_name }}</div>
          <div style="width: 230px">身份证号：{{ all2.ali_idcard }}</div>
        </div>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold">
        打款信息
      </div>
      <div style="width: 220px; display: inline-block">
        {{ all2.withdraw_at }},
      </div>
      <div
        style="width: 220px; margin-left: -76px; display: inline-block"
        v-if="all2.status == 0"
      >
        待打款
      </div>
      <div
        style="width: 220px; margin-left: -76px; display: inline-block"
        v-if="all2.status == 2"
      >
        打款中
      </div>
      <div
        style="width: 220px; margin-left: -76px; display: inline-block"
        v-if="all2.status == 10"
      >
        已打款
      </div>
      <div
        style="width: 220px; margin-left: -76px; display: inline-block"
        v-if="all2.status == 1"
      >
        打款失败
      </div>

      <div>
        <div style="width: 100px; display: inline-block">打款方式：</div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 1"
        >
          线下
        </div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 2"
        >
          云账户
        </div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 3"
        >
          支付宝
        </div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 4"
        >
          微信
        </div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 5"
        >
          工猫
        </div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 0 && all2.status != 0"
        >
          未知
        </div>
        <div
          style="width: 220px; display: inline-block"
          v-if="all2.pay_way == 0 && all2.status == 0"
        >
          -
        </div>
      </div>
      <div>
        <div
          style="width: 100px; display: inline-block"
          v-if="
            all2.pay_way == 2 ||
            all2.pay_way == 3 ||
            all2.pay_way == 4 ||
            all2.pay_way == 5
          "
        >
          打款订单ID:
        </div>
        <div style="width: 220px; display: inline-block">
          {{ all2.payment_txn }}
        </div>
      </div>
      <div
        style="
          font-size: 18px;
          margin-bottom: 20px;
          font-weight: bold;
          margin-top: 16px;
        "
      >
        转账备注
      </div>
      <el-input v-model="all2.withdraw_remark" placeholder="可修改"></el-input>
      <div
        style="
          font-size: 18px;
          margin-bottom: 20px;
          font-weight: bold;
          margin-top: 16px;
        "
        v-if="all2.pay_way == 1"
      >
        上传打款截图
      </div>
      <div
        v-if="!xianxiadakuanObj.withdraw_pic && all2.pay_way == 1"
        class="flexcc"
        style="
          width: 100%;
          height: 220px;
          background: rgb(246, 248, 251);
          margin-top: 15px;
        "
      >
        Ctrl+V直接粘贴截图
      </div>
      <div
        v-if="xianxiadakuanObj.withdraw_pic && all2.pay_way == 1"
        class="flexcc"
        style="width: 100%; margin-top: 10px; background: rgb(246, 248, 251)"
      >
        <img :src="xianxiadakuanObj.withdraw_pic" style="max-width: 100%" />
      </div>
      <div>
        <el-button
          type="info"
          style="width: 100%"
          v-if="xianxiadakuanObj.withdraw_pic && all2.pay_way == 1"
          @click="changeImg"
          >更换图片</el-button
        >
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button round @click="undo" style="border-radius: 20px">
          取消
        </el-button>
        <el-button
          type="danger"
          @click="updateDetails"
          style="border-radius: 20px"
        >
          保存修改
        </el-button>
      </div>
    </el-dialog>
    <!-- 修改后的打款弹窗 -->
    <el-dialog
      :title="tixianren"
      :visible.sync="log2"
      width="800px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold">
        提现金额
      </div>
      <div
        style="
          background: rgb(255, 245, 245);
          border-radius: 10px;
          padding: 20px;
          justify-content: space-around;
          margin-bottom: 20px;
        "
        class="flexc"
      >
        <div style="text-align: center">
          <div
            style="color: rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px"
          >
            提现金额
          </div>
          <div
            style="color: rgb(254, 61, 61); font-size: 16px; font-weight: bold"
          >
            ￥{{ all2.sum_commission }}
          </div>
        </div>
        <div style="text-align: center">
          <div
            style="color: rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px"
          >
            扣除税额
          </div>
          <div
            style="color: rgb(254, 61, 61); font-size: 16px; font-weight: bold"
          >
            ￥{{ all2.tax_amount }}
          </div>
        </div>
        <div style="text-align: center">
          <div
            style="color: rgb(64, 66, 71); font-size: 16px; margin-bottom: 10px"
          >
            实际应打款金额
          </div>
          <div
            style="color: rgb(254, 61, 61); font-size: 16px; font-weight: bold"
          >
            ￥{{ all2.withdraw_amount }}
          </div>
        </div>
      </div>
      <div
        style="
          font-size: 18px;
          margin-bottom: 20px;
          font-size: 14px;
          display: inline-block;
        "
      >
        开票类型:
      </div>
      <!-- <div v-if="all2.invoice_type==1||all2.invoice_type==2||all2.invoice_type==3" style="display: inline-block;">增值税专用发票</div>
      <div v-if="all2.invoice_type==4" style="display: inline-block;">增值税普通发票</div>
      <div v-if="all2.invoice_type==5" style="display: inline-block;">无发票</div> -->
      <div style="display: inline-block">{{ all2.invoice_info }}</div>
      <div
        v-if="
          all2.invoice_type == 1 ||
          all2.invoice_type == 2 ||
          all2.invoice_type == 3 ||
          all2.invoice_type == 4
        "
        style="
          display: inline-block;
          margin-left: 40px;
          color: rgb(0, 90, 255);
          cursor: pointer;
        "
        @click="viewFapiao"
      >
        查看发票
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold">
        收款账户
      </div>
      <div style="margin-bottom: 20px">
        <div
          class="flex"
          style="margin-bottom: 20px"
          v-if="all2.collect_type == 1"
        >
          <div style="width: 220px">卡号：{{ all2.bank_no }}</div>
          <div style="width: 220px; margin-left: 31px">
            开户人：{{ all2.bank_name }}
          </div>
          <div style="width: 230px; margin-left: -70px">
            身份证号：{{ all2.bank_idcard }}
          </div>
          <div style="width: 220px">开户行:{{ all2.bank }}</div>
          <div style="width: 220px; margin-left: 31px">
            开户支行:{{ all2.bank_sub }}
          </div>
        </div>
        <div
          class="flex"
          style="margin-bottom: 20px"
          v-if="all2.collect_type == 2"
        >
          <div style="width: 220px">支付宝号：{{ all2.ali_no }}</div>
          <div style="width: 220px">姓名：{{ all2.ali_name }}</div>
          <div style="width: 230px">身份证号：{{ all2.ali_idcard }}</div>
        </div>
        <div
          class="flex"
          style="margin-bottom: 20px"
          v-if="all2.collect_type == 3"
        >
          <div style="width: 220px">微信号：{{ all2.ali_no }}</div>
          <div style="width: 220px">姓名：{{ all2.ali_name }}</div>
          <div style="width: 230px">身份证号：{{ all2.ali_idcard }}</div>
        </div>
      </div>
      <div style="font-size: 18px; margin-bottom: 20px; font-weight: bold">
        支付佣金
      </div>
      <el-tabs
        style="box-shadow: none"
        type="border-card"
        @tab-click="chooseZhifuWays"
        v-model="activeName"
      >
        <el-tab-pane
          label="工猫支付"
          name="gongmaozhifu"
          v-if="gongmaoPaneShow"
        >
          <div
            style="
              font-size: 15px;
              margin-bottom: 20px;
              font-weight: bold;
              margin-top: 20px;
            "
          >
            工猫账户余额：{{ gongmaozhifuYue }}元
            <p style="display: inline; margin-left: 42px">
              本次支付 {{ all2.withdraw_amount }}元
            </p>
            <span
              v-if="gongmaozhifuYue * 1 >= all2.withdraw_amount * 1"
              style="margin-left: 10px; color: #67c23a"
              >余额充足</span
            >
            <span v-else style="margin-left: 10px; color: #f56c6c"
              >余额不足</span
            >
          </div>
          <div style="margin-bottom: 20px; display: inline">支付备注</div>
          <el-input
            v-model="gongmaozhifuObj.withdraw_remark"
            style="width: 320px; margin-left: 16px"
            placeholder="请输入支付备注"
          ></el-input>
        </el-tab-pane>

        <el-tab-pane
          label="云账户支付"
          name="yunzhanghuzhifu"
          v-if="yzhPaneShow"
        >
          <div
            style="
              font-size: 15px;
              margin-bottom: 20px;
              font-weight: bold;
              margin-top: 20px;
            "
          >
            云账户余额：{{ yunzhanghuYue }}元
            <p style="display: inline; margin-left: 42px">
              本次支付 {{ all2.withdraw_amount }}元
            </p>
            <span
              v-if="yunzhanghuYue * 1 >= all2.withdraw_amount * 1"
              style="margin-left: 10px; color: #67c23a"
              >余额充足</span
            >
            <span v-else style="margin-left: 10px; color: #f56c6c"
              >余额不足</span
            >
          </div>
          <div style="margin-bottom: 20px; display: inline">支付备注</div>
          <el-input
            v-model="yunzhanghuObj.withdraw_remark"
            style="width: 320px; margin-left: 16px"
            placeholder="请输入支付备注"
          ></el-input>
        </el-tab-pane>

        <el-tab-pane label="支付宝支付" name="zhifubaozhifu" v-if="zfbPaneShow">
          <!-- <div>
            <el-select clearable filterable style="width: 200px; margin-right: 30px" v-model="all2.pay_type" placeholder="请选择">
              <el-option label="支付宝" :value="0"></el-option>
              <el-option label="安全发" :value="1"></el-option>
            </el-select>
          </div> -->
          <div
            style="
              font-size: 15px;
              margin-bottom: 20px;
              font-weight: bold;
              margin-top: 20px;
            "
          >
            支付宝账户余额：{{ zhibaofuyue }}元
            <p style="display: inline; margin-left: 42px">
              本次支付 {{ all2.withdraw_amount }}元
            </p>
            <span
              v-if="zhibaofuyue * 1 >= all2.withdraw_amount * 1"
              style="margin-left: 10px; color: #67c23a"
              >余额充足</span
            >
            <span v-else style="margin-left: 10px; color: #f56c6c"
              >余额不足</span
            >
          </div>
          <div style="margin-bottom: 20px; display: inline">支付备注</div>
          <el-input
            v-model="zhifubaoObj.withdraw_remark"
            style="width: 320px; margin-left: 16px"
            placeholder="请输入支付备注"
          ></el-input>
        </el-tab-pane>

        <el-tab-pane label="微信支付" name="weixinzhifu" v-if="wxPaneShow">
          <div style="margin-bottom: 20px; display: inline">支付备注</div>
          <el-input
            v-model="weixinObj.withdraw_remark"
            style="width: 320px; margin-left: 16px"
            placeholder="请输入支付备注"
          ></el-input>
        </el-tab-pane>

        <el-tab-pane label="线下打款" name="xianxiadakuan">
          <div style="margin-bottom: 20px; display: inline">支付备注</div>
          <el-input
            v-model="xianxiadakuanObj.withdraw_remark"
            style="width: 320px; margin-left: 16px"
            placeholder="请输入支付备注"
          ></el-input>
          <div
            v-if="!xianxiadakuanObj.withdraw_pic"
            class="flexcc"
            style="
              width: 100%;
              height: 220px;
              background: rgb(246, 248, 251);
              margin-top: 15px;
            "
          >
            Ctrl+V直接粘贴截图
          </div>
          <div
            v-if="xianxiadakuanObj.withdraw_pic"
            class="flexcc"
            style="
              width: 100%;
              margin-top: 10px;
              background: rgb(246, 248, 251);
            "
          >
            <img :src="xianxiadakuanObj.withdraw_pic" style="max-width: 100%" />
          </div>
        </el-tab-pane>
      </el-tabs>
      <div slot="footer" class="dialog-footer">
        <el-button round @click="guanbitanchuang" style="border-radius: 20px">
          取消
        </el-button>
        <el-button
          type="danger"
          @click="makesurePay"
          style="border-radius: 20px"
          :disabled="paybtnshow"
        >
          确定打款
        </el-button>
      </div>
    </el-dialog>
    <!-- 打款或查看详情弹窗中点击查看发票 -->
    <el-dialog
      title="查看发票"
      :visible.sync="fapiaoDialog"
      width="820px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <!-- <div> {{ all2 }}</div> -->
      <div v-if="all2.invoice_way == 2" style="margin-bottom: 20px">
        物流公司：{{ all2.track_company }}
      </div>
      <div v-if="all2.invoice_way == 2">单号：{{ all2.track_no }}</div>
      <div v-if="all2.invoice_way == 1">
        <a
          :href="all2.invoice_img"
          target="_blank"
          style="color: rgb(0, 90, 255)"
          >{{ all2.invoice_img }}</a
        >
      </div>
      <div v-if="all2.invoice_way == 1" class="flexcc" style="margin: 20px 0">
        <el-button round plain type="primary" @click="down(all2.invoice_img)"
          >下载</el-button
        >
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button round @click="fapiaoDialog = false">关闭</el-button>
      </span>
    </el-dialog>

    <!-- 列表中点击票据类型出来的弹窗 -->
    <el-dialog
      title="查看发票"
      :visible.sync="log6"
      width="820px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <div v-if="log6fapiao.invoice_way == 2" style="margin-bottom: 20px">
        物流公司：{{ log6fapiao.track_company }}
      </div>
      <div v-if="log6fapiao.invoice_way == 2">
        单号：{{ log6fapiao.track_no }}
      </div>
      <div v-if="log6fapiao.invoice_way == 1">
        <a
          :href="log6fapiao.invoice_img"
          target="_blank"
          style="color: rgb(0, 90, 255)"
          >{{ log6fapiao.invoice_img }}</a
        >
      </div>
      <div
        v-if="log6fapiao.invoice_way == 1"
        class="flexcc"
        style="margin: 20px 0"
      >
        <el-button
          round
          plain
          type="primary"
          @click="down(log6fapiao.invoice_img)"
          >下载</el-button
        >
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button round @click="log6 = false">关闭</el-button>
      </span>
    </el-dialog>
    <!-- 云账户打款弹窗 -->
    <el-dialog
      title="云账户打款"
      :visible.sync="isshowyzhpay"
      :close-on-click-modal="false"
      width="400px"
    >
      <div style="text-align: center; font-size: 16px">
        <div style="margin-bottom: 30px">
          您将使用云账户支付：￥{{ iscanpayinfo.withdraw_amount }}
        </div>
        <div style="font-weight: bold">
          云账户余额：{{ iscanpayinfo.total_balance }}元
          <span
            v-if="
              iscanpayinfo.total_balance * 1 >= iscanpayinfo.withdraw_amount * 1
            "
            style="margin-left: 10px; color: #67c23a"
            >充足</span
          >
          <span v-else style="margin-left: 10px; color: #f56c6c">不足</span>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="isshowyzhpay = false">取 消</el-button>
        <el-button
          :disabled="
            iscanpayinfo.total_balance * 1 < iscanpayinfo.withdraw_amount * 1
          "
          round
          type="primary"
          @click="surepay"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <!-- 支付宝打款弹窗 -->
    <el-dialog
      title="支付宝打款"
      :visible.sync="isshowyzhpay2"
      :close-on-click-modal="false"
      width="400px"
    >
      <div style="text-align: center; font-size: 16px">
        <div style="margin-bottom: 30px">
          您将使用支付宝支付：￥{{ rowinfo.withdraw_amount }}
        </div>
        <div style="font-weight: bold">
          支付宝余额：{{ iscanpayinfo2.available_amount }}元
          <span
            v-if="
              iscanpayinfo2.available_amount * 1 >= rowinfo.withdraw_amount * 1
            "
            style="margin-left: 10px; color: #67c23a"
            >充足</span
          >
          <span v-else style="margin-left: 10px; color: #f56c6c">不足</span>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button round @click="isshowyzhpay2 = false">取 消</el-button>
        <el-button
          :disabled="
            iscanpayinfo2.available_amount * 1 < rowinfo.withdraw_amount * 1
          "
          round
          type="primary"
          @click="surepay2"
          >确 定</el-button
        >
      </span>
    </el-dialog>
    <!-- 点击列表申请提现人出现的弹窗 -->
    <el-dialog
      title="详细信息"
      :visible.sync="xiangxilog"
      :close-on-click-modal="false"
      width="630px"
    >
      <div>
        <div class="flexc" style="margin-bottom: 20px">
          <div style="width: 120px; padding-right: 20px">登录账号名：</div>
          <div style="color: rgb(130, 130, 130)">{{ xiangxixinxi.name }}</div>
        </div>
        <div class="flexc" style="margin-bottom: 20px">
          <div style="width: 120px; padding-right: 20px">联系电话：</div>
          <div style="color: rgb(130, 130, 130)">{{ xiangxixinxi.mobile }}</div>
        </div>
        <div class="flexc" style="margin-bottom: 20px">
          <div style="width: 120px; padding-right: 20px">实名信息：</div>
          <div style="color: rgb(130, 130, 130)">
            <div class="flexc">
              <div style="margin-right: 20px">
                {{ xiangxixinxi.user_infos.ali_name }}
              </div>
              <div>{{ xiangxixinxi.user_infos.ali_idcard }}</div>
            </div>
            <div class="flexc">
              <div style="margin-right: 20px">
                {{ xiangxixinxi.user_infos.bank_name }}
              </div>
              <div>{{ xiangxixinxi.user_infos.bank_idcard }}</div>
            </div>
          </div>
        </div>
        <div class="flexc" style="margin-bottom: 20px">
          <div style="width: 120px; padding-right: 20px">分销链路:</div>
          <div style="color: rgb(130, 130, 130)">
            <div
              v-for="(item, index) in fenxiaolianlu"
              :key="index"
              style="float: left"
            >
              <span v-if="index">></span>
              <span> {{ index + 1 }} {{ item.name }}</span>
            </div>
          </div>
        </div>
      </div>
      <div style="margin-top: 20px; text-align: center">
        <el-button type="primary" @click="xiangxilog = false">确 定</el-button>
      </div>
    </el-dialog>

    <!-- 手机版 -->
    <div
      v-if="shoujiban"
      style="
        color: rgb(2, 12, 29);
        font-size: 0.24rem;
        background: #f6f8fb;
        padding-top: 1rem;
      "
    >
      <topandleft></topandleft>
      <div style="background: #fff; padding: 0.3rem">
        <div class="flexc" style="margin-bottom: 0.3rem">
          <div
            style="
              width: 2px;
              height: 0.2rem;
              background: rgb(2, 12, 29);
              margin-right: 10px;
              overflow: hidden;
            "
          ></div>
          <div style="font-size: 0.36rem; font-weight: bold">佣金结算</div>
        </div>
        <div class="flexc" style="margin-bottom: 0.3rem">
          <div style="color: rgb(175, 179, 188)">首页</div>
          <div style="margin: 0 0.2rem; color: rgb(175, 179, 188)">·</div>
          <div style="color: rgb(175, 179, 188)">佣金结算</div>
          <div style="margin: 0 0.2rem; color: rgb(175, 179, 188)">·</div>
          <div>佣金打款</div>
        </div>
      </div>
      <div
        style="
          padding: 0.1rem;
          margin: 0.2rem 0.3rem 0 0.3rem;
          margin-top: 0.2rem;
        "
      >
        <div class="flex">
          <!-- <div @click="changestatus(0)" style="flex: 1; background: rgb(255, 255, 255); color: rgb(64, 66, 71); text-align: center; line-height: 0.7rem; border-radius: 0.35rem;" :class="{act:search.status == 0}">待打款</div>
            <div @click="changestatus(10)" style="flex: 1; background: rgb(255, 255, 255); color: rgb(64, 66, 71); text-align: center; line-height: 0.7rem; border-radius: 0.35rem;" :class="{act:search.status == 10}">已打款</div> -->
          <div>
            <el-button
              style="margin: 0px 10px"
              type="primary"
              v-if="search.status != 10"
              round
              @click="changestatus('')"
              >待打款</el-button
            >
          </div>
          <div>
            <el-button
              style="margin: 0px 10px"
              v-if="search.status == 10"
              round
              @click="changestatus()"
              >待打款</el-button
            >
          </div>
          <div>
            <el-button
              style="margin: 0px 10px"
              v-if="search.status != 10"
              round
              @click="changestatus(10)"
              >已打款</el-button
            >
          </div>
          <div>
            <el-button
              style="margin: 0px 10px"
              type="primary"
              v-if="search.status == 10"
              round
              @click="changestatus(10)"
              >已打款</el-button
            >
          </div>
        </div>
      </div>
      <div style="padding: 0.3rem">
        <div style="background: #fff; padding: 0.2rem; border-radius: 0.2rem">
          <div>
            <el-input
              v-model="search.merchant_name"
              style="width: 100%; margin-bottom: 0.2rem"
              placeholder="请输入提现人"
            ></el-input>
          </div>
          <div v-if="dakuanStatus">
            <el-select
              clearable
              filterable
              style="width: 100%; margin-bottom: 0.2rem"
              v-model="search.status"
              placeholder="请选择打款状态"
            >
              <!-- <el-option  label="已打款"  value="10"></el-option>
                <el-option  label="待打款"  value="0"></el-option> -->
              <el-option label="待打款" value="0"></el-option>
              <el-option label="打款失败" value="1"></el-option>
              <el-option label="打款中" value="2"></el-option>
              <el-option label="已驳回" value="5"></el-option>
            </el-select>
          </div>
          <div class="flexbc" style="margin-bottom: 0.2rem">
            <div
              class="datashow"
              @click="xuanshijianshow(1)"
              style="color: #c0c4cc"
              v-if="!search.start"
            >
              请选择开始日期
            </div>
            <div
              class="datashow"
              @click="xuanshijianshow(1)"
              v-if="search.start"
            >
              {{ search.start }}
            </div>
            <div>~</div>
            <div
              class="datashow"
              @click="xuanshijianshow(2)"
              style="color: #c0c4cc"
              v-if="!search.end"
            >
              请选择结束日期
            </div>
            <div class="datashow" @click="xuanshijianshow(2)" v-if="search.end">
              {{ search.end }}
            </div>
          </div>
          <van-popup v-model="showdate" round position="bottom">
            <van-datetime-picker
              type="date"
              :min-date="minDate"
              title="选择时间"
              @confirm="xuanshijian"
              @cancel="showdate = false"
            />
          </van-popup>
          <!-- <div class="flex" >
              <el-date-picker
                style="width: 46%;margin-bottom: 0.2rem;"
                v-model="search.start"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择开始日期">
              </el-date-picker>
              <span style="margin-left: 10px;margin-right: 10px;color: #AFB3BC;">-</span>
              <el-date-picker
                style="width: 46%;margin-bottom: 0.2rem;"
                v-model="search.end"
                value-format="yyyy-MM-dd HH:mm:ss"
                type="datetime"
                placeholder="选择结束日期">
              </el-date-picker>
            </div> -->
          <div>
            <el-button
              type="primary"
              round
              icon="el-icon-search"
              @click="sousuo"
              >检索</el-button
            >
            <el-button
              type="primary"
              round
              icon="el-icon-search"
              @click="peizhikai"
              >发票配置</el-button
            >
          </div>
        </div>
      </div>
      <div style="margin: 0 0.3rem">
        <van-list
          v-model="loading"
          :finished="finished"
          finished-text="没有更多了"
          @load="onLoad"
        >
          <div
            v-for="item in list"
            :key="item.id"
            style="
              background: #fff;
              padding: 0.2rem;
              margin-bottom: 0.2rem;
              border-radius: 0.2rem;
            "
          >
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>提现ID</div>
              <div>{{ item.id }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>申请提现人</div>
              <div>{{ item.shop_name }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>提现申请时间</div>
              <div>{{ item.withdraw_at }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>提现订单数量</div>
              <div>{{ item.orders_count }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>提现金额</div>
              <div>{{ item.sum_commission }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>票据类型</div>
              <div>{{ item.invoice_way }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>扣除税点金额</div>
              <div>{{ item.tax_amount }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>实际支出金额</div>
              <div>{{ item.withdraw_amount }}</div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>打款状态</div>
              <div>
                <!-- <div v-if="item.status == 10" style="color: rgb(9, 134, 0);">已打款</div>
                    <div v-if="item.status == 0" style="color: rgb(236, 82, 1);">待打款</div> -->
                <div v-if="item.status == 10" style="color: rgb(9, 134, 0)">
                  已打款
                </div>
                <div v-if="item.status == 0" style="color: rgb(236, 82, 1)">
                  待打款
                </div>
                <div v-if="item.status == 1" style="color: rgb(236, 82, 1)">
                  打款失败
                </div>
                <div v-if="item.status == 2" style="color: rgb(236, 82, 1)">
                  打款中
                </div>
                <div v-if="item.status == 5" style="color: rgb(236, 82, 1)">
                  已驳回
                </div>
                <div v-if="item.status == 11" style="color: rgb(9, 134, 0)">
                  已自动打款
                </div>
                <div v-if="item.status == 15" style="color: rgb(236, 82, 1)">
                  自动打款失败
                </div>
              </div>
            </div>
            <div class="flexbc" style="margin-bottom: 0.2rem">
              <div>打款时间</div>
              <div>{{ item.withdraw_at }}</div>
            </div>
            <div class="flexc">
              <div
                style="
                  color: rgb(0, 90, 255);
                  cursor: pointer;
                  margin-right: 20px;
                "
                @click="luru(item, 2)"
              >
                录入打款信息
              </div>
              <div style="color: rgb(0, 90, 255); cursor: pointer">
                云账户打款
              </div>
            </div>
          </div>
        </van-list>
      </div>
    </div>
  </div>
</template>

<script>
import left from "../left.vue";
import top from "../top.vue";
import footers from "../footer.vue";
import * as qiniu from "qiniu-js";
import topandleft from "../topandleft.vue";
import area from "../../../static/img/areanew.json";
export default {
  name: "yongjindakuan",
  components: {
    left,
    top,
    topandleft,
    footers,
  },
  data() {
    return {
      log: false,
      log2: false,
      log3: false,
      search: {
        page: 1,
        page_size: 20,
        merchant_name: "",
        status: "",
        start: "",
        end: "",
        payment_type: "",
        pay_way: 0,
      },
      list: [],
      total: 0,
      all: {
        checkedCities: [],
      },
      widthss: false,
      fapiaoall: {
        configs: "",
      },
      fapiaojson: [],
      all2: {},
      times: [],
      log6: false,
      log6fapiao: "",
      tixianren: "提现人",
      isshowyzhpay: false,
      isshowyzhpay2: false,
      rowinfo: "",
      nowmoneyobj: {},
      iscanpayinfo: {},
      iscanpayinfo2: {},
      shoujiban: false,
      loading: false,
      finished: false,
      lurutype: "",
      showdate: false,
      whodata: "",
      minDate: new Date(2023, 0, 1),
      areaList: "",
      show: false,
      ksradio: "",
      zhibaofuyue: 0,
      gongmaozhifuYue: "",
      yunzhanghuYue: "",
      zhifubaom: false,
      gongmaozhifuObj: {
        //公猫打款参数
        id: "",
        type: "2",
        withdraw_remark: "",
      },
      yunzhanghuObj: {
        //云账户打款参数
        id: "",
        type: "1",
        withdraw_remark: "",
      },
      zhifubaoObj: {
        //支付宝打款参数
        id: "",
        withdraw_remark: "",
      },
      weixinObj: {
        //微信打款参数
        id: "",
        withdraw_remark: "",
      },
      xianxiadakuanObj: {
        //线下支付参数
        id: "",
        withdraw_remark: "",
        withdraw_pic: "",
      },
      paybtnshow: false,
      activeName: "gongmaozhifu",
      fapiaoDialog: false,
      gongmaoPaneShow: false, //工猫支付pane
      yzhPaneShow: false, //云支付pane
      zfbPaneShow: false, //支付宝pane
      wxPaneShow: false, //微信支付pane
      boHuiDialog: false,
      boHuiObj: {
        id: "",
        remark: "",
      },
      zidongdakuanDialog: false,
      isDakuanObj: {
        auto_payment: false, //自动打款配置 0否  1是
        payment_type: "", // 2云账户  5工猫
      },
      pingtaioptions: [
        //2云账户    5工猫
        // {
        //   value: '2',
        //   label: '云账户'
        // },
        // {
        //   value: '5',
        //   label: '工猫'
        // }
      ],
      switchshow: "",
      fenxiaolianlu: [], //分销线路
      xiangxilog: false,
      xiangxixinxi: {
        user_infos: "",
      },
      dakuanStatus: true,
      jinriJine: "",
      lishijine: "",
      wait_count:"",
      wait_money:""
    };
  },
  created() {
    this.areaList = area;
    // this.getlist()
    this.getfapiao();
    //账户余额
    this.nowmoney();
    this.getjine();
  },
  mounted() {
    if (window.screen.width == 1920) {
      this.widthss = true;
    }

    document.addEventListener("paste", this.getClipboardFiles);

    if (window.screen.width < 1080) {
      this.shoujiban = true;
      var h = document.documentElement.clientWidth / 7.5 + "px";
      document.documentElement.style.fontSize = h;

      // this.onLoad()
    } else {
      this.getlist();
    }

    // axios.get("/own/ali/pay/balance").then((response) => {
    //   if (response.data.msg.code == 0) {
    //     this.zhibaofuyue = response.data.data.available_amount;
    //   } else {
    //     this.$message.error(response.data.msg.info);
    //   }
    // });

    axios.get("/own/ali/pay/get").then((response) => {
      if (response.data.msg.code == 0) {
        if (response.data.data.ali_name) {
          this.zhifubaom = true;
        } else {
        }
      } else {
        this.$message.error(response.data.msg.info);
      }
    });
  },
  methods: {
    uploasd: function (file) {
      let ff = this.duwenjian(file);

      ff.then((res) => {
        let data = [];
        res.forEach((item) => {
          let obj = {
            id: parseInt(item["提现ID"]),
            withdraw_remark: item["备注"]
          };
          data.push(obj);
        });

        this.$confirm('您确定要线下打款批量确认吗？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          axios
            .post("/own/commission/offline/payment/import", {datas:data})
            .then((response) => {
              if (response.data.msg.code == 0) {
                this.$message.success(`上传成功`);
                this.getlist();
                // this.$message.success(`上传成功${response.data.data.suc}个`);
                // if (response.data.data.fail.length != 0) {
                //   this.isshowfail = true;
                //   this.failmsg = response.data.data.fail;
                // }
                // this.sousuo();
                // this.mimalog = false;
              } else {
                this.$message.error(response.data.msg.info);
              }
            });
        })


      });
    },
    daochu: function () {
      axios
        .get("/own/commission/withdrawtake/wait/exp", { params: this.search })
        .then((response) => {
          if (response.data.msg.code == 0) {
            window.location.href = response.data.data;
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //省市区确认
    queren: function (v) {
      if (!v[0].code || !v[1].code || !v[2].code) {
        this.$message.error("请完整选择省市区");
        return false;
      }

      this.fapiaoall.addr_province = v[0].name;
      this.fapiaoall.addr_city = v[1].name;
      this.fapiaoall.addr_district = v[2].name;

      this.show = false;
    },
    //省市区取消
    quxiao: function () {
      this.show = false;
    },

    xuanshijianshow: function (val) {
      if (val == 1) {
        this.showdate = true;
        this.whodata = "start";
      }
      if (val == 2) {
        this.showdate = true;
        this.whodata = "end";
      }
    },
    xuanshijian: function (val) {
      this.search[this.whodata] = moment(val).format("YYYY-MM-DD hh:mm:ss");
      this.showdate = false;
    },
    onLoad() {
      if (this.search.status == "10") {
        this.search.payment_type = "";
      } else {
        this.search.payment_type = 1;
      }
      axios
        .get("/own/commission/withdrawtakes", { params: this.search })
        .then((response) => {
          if (response.data.msg.code == 0) {
            if (response.data.data.data.length > 0) {
              response.data.data.data.forEach((item) => {
                this.list.push(item);
              });
              // console.log('this.list,this.list.length,response.data.data.total',this.list,this.list.length,response.data.data.total)
              if (this.list.length >= response.data.data.total) {
                this.finished = true;
              } else {
                this.search.page++;
                this.loading = false;
              }
            } else {
              this.finished = true;
            }
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    onLoad() {
      if (this.search.status == "10") {
        this.search.payment_type = "";
      } else {
        this.search.payment_type = 1;
      }
      axios
        .get("/own/commission/withdrawtakes", { params: this.search })
        .then((response) => {
          if (response.data.msg.code == 0) {
            if (response.data.data.data.length > 0) {
              response.data.data.data.forEach((item) => {
                this.list.push(item);
              });
              console.log(
                "this.list,this.list.length,response.data.data.total",
                this.list,
                this.list.length,
                response.data.data.total
              );
              if (this.list.length >= response.data.data.total) {
                this.finished = true;
              } else {
                // alert('233333333333333333333')
                this.search.page++;
                this.loading = false;
              }
            } else {
              this.finished = true;
            }
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    down: function (item) {
      window.location.href = item;
    },
    log6show: function (item) {
      this.log6fapiao = item;
      this.log6 = true;
    },
    changestatus: function (val) {
      this.search.page = 1;
      if (val) {
        this.search.status = val.toString();
        this.dakuanStatus = false;
      } else {
        this.search.status = "";
        this.search.pay_way = 0;
        this.dakuanStatus = true;
      }
      if (window.screen.width < 1080) {
        this.list = [];
        this.loading = true;
        this.finished = false;
        this.onLoad();
      } else {
        this.getlist();
      }
    },
    changetimes: function () {
      if (this.times != null) {
        this.search.start = this.times[0];
        this.search.end = this.times[1];
      } else {
        this.search.start = "";
        this.search.end = "";
      }
    },
    //传图相关====================
    getClipboardFiles(event) {
      let items = event.clipboardData && event.clipboardData.items;
      let file = null;
      if (this.log2 == true || this.log3 == true) {
        console.log("1212121");
        if (items && items.length) {
          // 检索剪切板items
          for (var i = 0; i < items.length; i++) {
            if (items[i].type.indexOf("image") !== -1) {
              file = items[i].getAsFile();
            }
          }
        }
        if (!file) {
          this.$message.error("粘贴内容不是图片");
          return;
        }
        this.uploadok(file);
        // this.wenjian = file
        // var that = this
        // var reader = new FileReader(), htmlImage;
        // reader.onload = function(e) {
        //   console.log(e)
        //     // that.imageurl = e.target.result
        //     // that.tixianxinxi.image = e.target.result
        // }
        // reader.readAsDataURL(file);
      }
    },
    getRandomChar: function (len = 11) {
      var x = "0123456789qwertyuioplkjhgfdsazxcvbnm"; // 需要什么字符这里添加
      var tmp = "";
      var timestamp = new Date().getTime();
      for (var i = 0; i < len; i++) {
        tmp += x.charAt(Math.ceil(Math.random() * 100000000) % x.length);
      }
      return timestamp + tmp;
    },
    uploadok: function (file) {
      let name = this.getRandomChar() + "." + file.name.split(".")[1];
      var that = this;
      axios.post(`/api/qiniu/uploadtoken`, { name: name }).then((response) => {
        if (response.data.msg.code == 0) {
          const observer = {
            next(res) {
              console.log(res);
            },
            error(err) {
              console.log(err);
            },
            complete(res) {
              that.xianxiadakuanObj.withdraw_pic =
                "https://gperson.gantanhaokeji.top/" + res.key;
            },
          };
          const observable = qiniu.upload(
            file,
            name,
            response.data.data.token,
            {},
            {}
          );
          const subscription = observable.subscribe(observer);
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //=============================================================
    // quedingdakuan:function(){
    //   let obj = {
    //     id:this.all2.id,
    //     withdraw_pic:this.all2.withdraw_pic,
    //     withdraw_remark:this.all2.withdraw_remark
    //   }
    //   axios.post('/own/commission/dowithdraw',obj).then((response)=>{
    //   	if (response.data.msg.code == 0) {
    //       this.$message.success('确认打款操作成功');
    //       this.getlist()
    //       this.log2 = false
    //   	} else {
    //   		this.$message.error(response.data.msg.info);
    //   	}
    //   })
    // },
    peizhikai: function () {
      this.getfapiao();
      this.log = true;
    },
    peizhi: function () {
      let all = JSON.parse(JSON.stringify(this.fapiaoall));
      var obj = {
        data: all.configs.data,
        type: this.ksradio,
      };
      all.configs = JSON.stringify(obj);

      axios.post("/own/invoice/make", all).then((response) => {
        if (response.data.msg.code == 0) {
          this.$message.success("修改成功");
          this.getfapiao();
          this.log = false;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    getfapiao: function () {
      axios.get("/own/invoice/info").then((response) => {
        if (response.data.msg.code == 0) {
          this.fapiaoall = response.data.data;
          this.fapiaoall.configs = JSON.parse(this.fapiaoall.configs);
          for (var x = 0; x < this.fapiaoall.configs.data.length; x++) {
            if (this.fapiaoall.configs.data[x].moren == undefined) {
              this.fapiaoall.configs.data[x].moren = "";
            }
          }
          console.log("--cs---");
          console.log(this.fapiaoall.configs);
          this.ksradio = this.fapiaoall.configs.type;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    handleCheckedCitiesChange(val) {
      this.fapiaojson = val;
      console.log(this.fapiaojson);
    },
    sousuo: function () {
      this.search.page = 1;
      if (window.screen.width < 1080) {
        this.list = [];
        this.loading = false;
        this.finished = false;
        this.onLoad();
      } else {
        this.getlist();
      }
    },
    getlist: function () {
      if (this.search.status == "10") {
        this.search.payment_type = "";
      } else {
        this.search.payment_type = 1;
      }
      axios
        .get("/own/commission/withdrawtakes", { params: this.search })
        .then((response) => {
          if (response.data.msg.code == 0) {
            this.list = response.data.data.data;
            this.total = response.data.data.total;
            this.loading = false;
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    fanye: function (val) {
      this.search.page = val;
      this.getlist();
    },
    //支付宝打款
    // payyzh(row,val){
    //   if(val == 2){
    //     this.rowinfo = row
    //     this.isshowyzhpay2 = true
    //     axios.get('/own/ali/pay/balance').then((response)=>{
    //     	if (response.data.msg.code == 0) {
    //         this.iscanpayinfo2 = response.data.data
    //         this.zhibaofuyue = response.data.data.available_amount
    //     	} else {
    //     		this.$message.error(response.data.msg.info);
    //     	}
    //     })
    //   }else{
    //     this.rowinfo = row
    //     this.isshowyzhpay = true
    //     axios.get('/own/commission/findAccount?id='+row.id).then((response)=>{
    //     	if (response.data.msg.code == 0) {
    //         console.log('查看是否可以支付')
    //         console.log(response.data.data)
    //         this.iscanpayinfo = response.data.data
    //     	} else {
    //     		this.$message.error(response.data.msg.info);
    //     	}
    //     })
    //   }
    // },
    surepay2: function () {
      let obj = {
        id: this.rowinfo.id,
      };
      axios.post("/own/ali/pay/payment", obj).then((response) => {
        if (response.data.msg.code == 0) {
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
      this.getlist();
      this.isshowyzhpay2 = false;
    },
    surepay() {
      let obj = {
        id: this.rowinfo.id,
        withdraw_pic: this.rowinfo.withdraw_pic,
        withdraw_remark: this.rowinfo.withdraw_remark,
      };
      axios.post("/own/commission/dowithdrawYun", obj).then((response) => {
        if (response.data.msg.code == 0) {
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
      this.getlist();
      this.isshowyzhpay = false;
    },
    //账户余额
    nowmoney() {
      axios.get("/own/commission/yunAccount").then((response) => {
        if (response.data.msg.code == 0) {
          console.log("账户余额");
          console.log(response.data.data);
          this.nowmoneyobj = response.data.data;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //百分比转小数
    toPoint(percent) {
      var str = percent.replace("%", "");
      str = str / 100;
      return str;
    },
    //小数转百分比
    toPercent(point, fixed) {
      var percent = Number(point * 100).toFixed(fixed);
      percent += "%";
      return percent;
    },
    //设为默认
    peimoren(i) {
      for (var x = 0; x < this.fapiaoall.configs.data.length; x++) {
        if (x == i) {
          var item = this.fapiaoall.configs.data[x];
          item.moren = 1;
          this.$set(this.fapiaoall.configs.data, x, item);
        } else {
          var item = this.fapiaoall.configs.data[x];
          item.moren = "";
          this.$set(this.fapiaoall.configs.data, x, item);
        }
      }

      // console.log(this.fapiaoall.configs.data)
    },
    //取消默认
    resmoren(i) {
      var item = this.fapiaoall.configs.data[i];
      item.moren = "";
      this.$set(this.fapiaoall.configs.data, i, item);
      // console.log(this.fapiaoall.configs.data[i])
    },
    //打款
    dakuan(dakuanScopeRow) {
      this.log2 = true;
      this.xianxiadakuanObj.withdraw_pic = "";
      axios
        .get("/own/commission/withdrawinfo?id=" + dakuanScopeRow.id)
        .then((response) => {
          if (response.data.msg.code == 0) {
            this.all2 = response.data.data.data;
            this.tixianren = `提现人${this.all2.shop_name}`;
            this.log2 = true;
            // invoice_type=1 增值税专用发票
            // invoice_type=2 增值税专用发票
            // invoice_type=3 增值税专用发票
            // invoice_type=4 增值税普通发票
            // invoice_type=5 无发票

            //collect_type  1 银行卡  2支付宝   3微信
            if (
              response.data.data.config.is_alipay == 1 &&
              response.data.data.data.collect_type == 2
            ) {
              //  是否已配置支付宝  is_alipay  0没配  1已配置
              this.zfbPaneShow = true;
            } else {
              this.zfbPaneShow = false;
            }

            if (
              response.data.data.config.is_yun == 1 &&
              response.data.data.data.invoice_type == 5
            ) {
              //是否已配置云支付 is_yun  0没配  1已配置
              this.yzhPaneShow = true;
            } else {
              this.yzhPaneShow = false;
            }

            if (response.data.data.config.is_gongmao == 1) {
              //是否已配置工猫支付   is_gongmao 0没配  1已配置
              this.gongmaoPaneShow = true;
              // this.lurutype = '0'
              // let obj={
              //   type:'2',
              //   id:dakuanScopeRow.id
              // }

              // axios.get('/own/commission/findAccount?id='+dakuanScopeRow.id+'&type='+obj.type).then((response)=>{
              //   if (response.data.msg.code == 0) {
              //     this.gongmaozhifuYue = response.data.data.total_balance

              //   } else {
              //     this.$message.error(response.data.msg.info);
              //   }
              // })
              // if(this.gongmaozhifuYue*1 >= this.all2.withdraw_amount*1){  //如果工猫账户余额充足
              //   this.paybtnshow = true
              // }else{
              //   this.paybtnshow = false
              // }

              // if(this.yunzhanghuYue*1 >= this.all2.withdraw_amount*1){ // 如果云账户余额充足
              //   this.paybtnshow = true
              // }else{
              //   this.paybtnshow = false
              // }
            } else {
              this.gongmaoPaneShow = false;
            }

            if (
              response.data.data.config.is_wexin == 1 &&
              response.data.data.data.collect_type == 3
            ) {
              //是否已配置微信支付  is_wexin  0没配  1已配置
              this.wxPaneShow = true;
            } else {
              this.wxPaneShow = false;
            }

            if (
              this.gongmaozhifuObj.withdraw_remark ||
              this.yunzhanghuObj.withdraw_remark ||
              this.zhifubaoObj.withdraw_remark ||
              this.weixinObj.withdraw_remark ||
              this.xianxiadakuanObj.withdraw_remark
            ) {
              this.gongmaozhifuObj.withdraw_remark = "";
              this.yunzhanghuObj.withdraw_remark = "";
              this.zhifubaoObj.withdraw_remark = "";
              this.weixinObj.withdraw_remark = "";
              this.xianxiadakuanObj.withdraw_remark = "";
              this.xianxiadakuanObj.withdraw_pic = "";
            }
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    chooseZhifuWays(tab, event) {
      console.log("666", tab, event);
      if (tab.name == "gongmaozhifu") {
        //工猫
        this.lurutype = "0";
        let obj = {
          type: "2",
          id: this.all2.id,
        };
        console.log("工猫参数", obj);

        axios
          .get(
            "/own/commission/findAccount?id=" +
              this.all2.id +
              "&type=" +
              obj.type
          )
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.gongmaozhifuYue = response.data.data.total_balance;
              if (this.gongmaozhifuYue * 1 >= this.all2.withdraw_amount * 1) {
                //如果工猫账户余额充足
                this.paybtnshow = false;
              } else {
                this.paybtnshow = true;
              }
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
      if (tab.name == "yunzhanghuzhifu") {
        this.lurutype = "1"; //云账户
        let obj = {
          type: "1",
        };
        axios
          .get(
            "/own/commission/findAccount?id=" +
              this.all2.id +
              "&type=" +
              obj.type
          )
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.yunzhanghuYue = response.data.data.total_balance;
              console.log(
                "云账户余额，本次支付",
                this.yunzhanghuYue,
                this.all2.withdraw_amount
              );
              if (this.yunzhanghuYue * 1 >= this.all2.withdraw_amount * 1) {
                //如果云账户余额充足
                this.paybtnshow = false;
              } else {
                this.paybtnshow = true;
              }
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
      if (tab.name == "zhifubaozhifu") {
        this.lurutype = "2"; //支付宝
        if (this.zhifubaom) {

          axios.get('/own/ali/safe/user/account/query').then((response)=>{
            if (response.data.msg.code == 0) {
              this.iscanpayinfo2 = response.data.data;
              this.zhibaofuyue = response.data.data.available_amount;
              if (this.zhibaofuyue * 1 >= this.all2.withdraw_amount * 1) {
                //如果支付宝账户余额充足
                this.paybtnshow = false;
              } else {
                this.paybtnshow = true;
              }
            } else {
              this.$message.error(response.data.msg.info);
            }
          })


          // axios.get("/own/ali/pay/balance").then((response) => {
          //   if (response.data.msg.code == 0) {
          //     this.iscanpayinfo2 = response.data.data;
          //     this.zhibaofuyue = response.data.data.available_amount;
          //     if (this.zhibaofuyue * 1 >= this.all2.withdraw_amount * 1) {
          //       //如果支付宝账户余额充足
          //       this.paybtnshow = false;
          //     } else {
          //       this.paybtnshow = true;
          //     }
          //   } else {
          //     this.$message.error(response.data.msg.info);
          //   }
          // });
        }
      }
      if (tab.name == "weixinzhifu") {
        //微信
        this.lurutype = "3";
        this.paybtnshow = false;
      }
      if (tab.name == "xianxiadakuan") {
        //线下
        this.lurutype = "4";
        this.paybtnshow = false;
      }
    },
    //关闭打佣金弹窗
    guanbitanchuang() {
      this.log2 = false;
    },
    //确认打佣金
    makesurePay() {
      console.log(this.lurutype);

      if (!this.lurutype) {
        this.$message.error("请选择打款方式");
        return;
      }
      if (this.lurutype == 0) {
        //最终工猫支付打款
        this.gongmaozhifuObj.id = this.all2.id;
        axios
          .post("/own/commission/dowithdrawYun", this.gongmaozhifuObj)
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "工猫支付成功！",
                type: "success",
              });
              this.log2 = false;
              this.getlist();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
      if (this.lurutype == 1) {
        //最终云账户打款
        this.yunzhanghuObj.id = this.all2.id;
        axios
          .post("/own/commission/dowithdrawYun", this.yunzhanghuObj)
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "云账户打款成功！",
                type: "success",
              });
              this.log2 = false;
              this.getlist();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
      if (this.lurutype == 2) {
        //最终支付宝支付打款
        this.zhifubaoObj.id = this.all2.id;
        this.zhifubaoObj.pay_type = 1;
        axios
          .post("/own/ali/pay/payment", this.zhifubaoObj)
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "支付宝打款成功！",
                type: "success",
              });
              this.log2 = false;
              this.getlist();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
      if (this.lurutype == 3) {
        //最终微信支付打款
        this.weixinObj.id = this.all2.id;
        axios
          .post("/own/wx/pay/verify/payment", this.weixinObj)
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "微信打款成功！",
                type: "success",
              });
              this.log2 = false;
              this.getlist();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
      if (this.lurutype == 4) {
        //线下打款
        console.log("5555", this.all2.id);
        this.xianxiadakuanObj.id = this.all2.id;
        axios
          .post("/own/commission/dowithdraw", this.xianxiadakuanObj)
          .then((response) => {
            if (response.data.msg.code == 0) {
              this.$message({
                message: "线下打款成功！",
                type: "success",
              });
              this.log2 = false;
              this.getlist();
            } else {
              this.$message.error(response.data.msg.info);
            }
          });
      }
    },
    //查看详情
    clickDetails(item) {
      axios
        .get("/own/commission/withdrawinfo?id=" + item.id)
        .then((response) => {
          if (response.data.msg.code == 0) {
            this.all2 = response.data.data.data;
            this.tixianren = `提现人${this.all2.shop_name}`;
            this.log3 = true;
            this.xianxiadakuanObj.withdraw_pic = this.all2.withdraw_pic;
          } else {
            this.$message.error(response.data.msg.info);
          }
        });
    },
    //取消查看详情
    undo() {
      this.log3 = false;
    },
    //保存修改
    updateDetails() {
      let obj = {
        id: this.all2.id,
        withdraw_pic: this.xianxiadakuanObj.withdraw_pic,
        withdraw_remark: this.all2.withdraw_remark,
      };
      axios.post("/own/commission/dowithdraw", obj).then((response) => {
        if (response.data.msg.code == 0) {
          this.$message.success("保存修改成功");
          this.getlist();
          this.log3 = false;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //更换图片
    changeImg() {
      this.xianxiadakuanObj.withdraw_pic = "";
      // this.all2.withdraw_pic = ''
      // document.addEventListener('paste', this.getClipboardFiles)
    },
    //查看发票
    viewFapiao() {
      this.fapiaoDialog = true;
    },
    //设为默认
    peimoren(i) {
      for (var x = 0; x < this.fapiaoall.configs.data.length; x++) {
        if (x == i) {
          var item = this.fapiaoall.configs.data[x];
          item.moren = 1;
          this.$set(this.fapiaoall.configs.data, x, item);
        } else {
          var item = this.fapiaoall.configs.data[x];
          item.moren = "";
          this.$set(this.fapiaoall.configs.data, x, item);
        }
      }

      // console.log(this.fapiaoall.configs.data)
    },
    //取消默认
    resmoren(i) {
      var item = this.fapiaoall.configs.data[i];
      item.moren = "";
      this.$set(this.fapiaoall.configs.data, i, item);
      // console.log(this.fapiaoall.configs.data[i])
    },
    //驳回
    boHui(boHuiScopeRow) {
      console.log("666", boHuiScopeRow);
      this.boHuiDialog = true;
      this.boHuiObj.remark = "";
      this.boHuiObj.id = boHuiScopeRow.id;
    },
    //确定驳回
    makeSureBohui() {
      axios
        .post("/own/commission/withdraws/reject", this.boHuiObj)
        .then((response) => {
          console.log("888", response);
          if (response.data.msg.code == 0) {
            this.$message.success("驳回成功");
            this.getlist();
            this.boHuiDialog = false;
          } else {
            this.$message.error(response.data.msg.info);
            this.boHuiDialog = false;
          }
        });
    },
    //取消
    undoBohui() {
      this.boHuiDialog = false;
    },
    getZhifuPay() {
      axios.get("/own/commission/withdrawinfo").then((response) => {
        if (response.data.msg.code == 0) {
          console.log("response11111", response);
          if (
            response.data.data.config.is_gongmao &&
            response.data.data.config.is_gongmao == "1"
          ) {
            //如果配置了工猫
            const obj = {
              value: "5",
              label: "工猫",
            };
            this.pingtaioptions.push(obj);
          }
          if (
            response.data.data.config.is_yun &&
            response.data.data.config.is_yun == "1"
          ) {
            //如果配置了云支付
            const obj = {
              value: "2",
              label: "云账户",
            };
            this.pingtaioptions.push(obj);
          }
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
      axios.get("/own/pay/payment/get").then((response) => {
        console.log("999", response);
        if (response.data.msg.code == 0) {
          if (response.data.data.auto_payment == "1") {
            this.isDakuanObj.auto_payment = true; //开
          }

          if (response.data.data.auto_payment == "0") {
            this.isDakuanObj.auto_payment = false; //关
          }

          if (response.data.data.payment_type == 2) {
            this.isDakuanObj.payment_type = "2";
          }
          if (response.data.data.payment_type == 5) {
            this.isDakuanObj.payment_type = "5";
          }
        }
      });
    },
    //自动打款配置点开弹窗自动获取反显
    zidongdakuan() {
      this.zidongdakuanDialog = true;
      this.pingtaioptions = [];
      this.getZhifuPay();
      if (this.pingtaioptions.length == 0) {
        this.pingtaioptions = [];
      }
    },
    //确认自动打款
    makeSurezidongdakuan() {
      if (this.isDakuanObj.auto_payment == true) {
        this.switchshow = "1";
      }
      if (this.isDakuanObj.auto_payment == false) {
        this.switchshow = "0";
      }
      let obj = {
        auto_payment: this.switchshow,
        payment_type: this.isDakuanObj.payment_type,
      };

      axios.post("/own/pay/payment/config", obj).then((response) => {
        if (response.data.msg.code == 0) {
          this.$message.success("设置成功！");
          this.zidongdakuanDialog = false;
          this.getlist();
        } else {
          this.$message.error(response.data.msg.info);
          this.zidongdakuanDialog = false;
          this.getlist();
        }
      });
    },
    //取消自动打款
    undozidongdakuan() {
      this.zidongdakuanDialog = false;
    },
    changeSwitch(val, row) {
      if (val == true) {
        this.switchshow = "1";
      }
      if (val == false) {
        this.switchshow = "0";
      }
    },
    //改变平台
    changepingtai(val) {
      this.isDakuanObj.payment_type = val;
    },
    //点击查看详细信息
    clickxiangxixinxi(item) {
      console.log("item1111", item);
      this.xiangxilog = true;
      axios.get("/own/agent/link?id=" + item.shop_id).then((response) => {
        console.log("response", response);
        if (response.data.msg.code == 0) {
          this.xiangxixinxi = response.data.data;
          this.fenxiaolianlu = this.xiangxixinxi.relation_tree;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
    //已进入界面获取右上角今日打款、历史打款金额
    getjine() {
      axios.get("/own/commission/money").then((response) => {
        if (response.data.msg.code == 0) {
          console.log("6666666", response);
          this.jinriJine = response.data.data.today_money;
          this.lishijine = response.data.data.total_money;
          this.wait_count = response.data.data.wait_count;
          this.wait_money  = response.data.data.wait_money;
        } else {
          this.$message.error(response.data.msg.info);
        }
      });
    },
  },
};
</script>
<style scoped>
/deep/.t_changec .el-textarea__inner {
  background: white !important;
  border-color: rgb(227, 232, 241);
}
</style>

<style scoped lang="less">
.yongjindakuan {
  /deep/ .el-checkbox {
    display: block;
    margin-bottom: 10px;
  }
  /deep/ .el-textarea__inner {
    background: rgb(236, 235, 235);
  }
  /deep/ .el-checkbox {
    margin-bottom: 0;
  }
  .act {
    background: rgb(0, 90, 255) !important;
    color: #fff !important;
  }
  /deep/ .van-area {
    background: #eaeaea;
  }
  .yongjindakuan[data-v-2575684a] .el-textarea__inner {
    background: #ecebeb !important;
  }
}
</style>
